package hook

import (
	"gitee.com/dreamwood/ez/server"
)

func init() {
	server.AddBeforeHandler("auth", func(operation *server.Operation) {
		//获取地址
		//api := operation.Handler.Router.Url
		////获取token
		//token := operation.GetHeader().Get(config.GetApi().AuthTokenName)
		////这里添加接口权限验证的逻辑
		//if !不能通过 {
		//	data := make(map[string]interface{})
		//	data["code"] = code.ErrorAuth
		//	data["message"] = "接口权限受限"
		//	data["data"] = ""
		//	operation.JsonOut(data)
		//	operation.IsStop = true
		//	return
		//}
	})
}
